#ifndef CSPHERE_H
#define CSPHERE_H
#include "intersectresult.h"
#include "cray.h"
#include "material.h"
#include "phongmaterial.h"
#include "cobject.h"

class CSphere : public CObject
{
public:
CSphere();
CSphere(GVector3 center,double radius);
CSphere(CSphere& s);
void setCenter(GVector3& c);
void setRadius(double r);

double GetRadiusSquare();


GVector3 getCenter();
double getRadius();
virtual GVector3 getNormal(GVector3 point);
virtual IntersectResult isIntersected(CRay& ray);

bool Intersect(CRay ray, float& t0, float& t1);

virtual ~CSphere();
private:
      GVector3 center;
      double radius;
};

#endif // CSPHERE_H
